from task01 import send_email
from datetime import datetime
from datetime import timedelta
#定时任务 方式一
# v1=datetime(2023,2,21,14,48,00)
# print(v1)
# v2=datetime.utcfromtimestamp(v1.timestamp())
# print(v2)
# result=send_email.apply_async(args=['牛有道',],eta=v2)
# print(result.id)
#定时任务 方式二
ctiem=datetime.now()
uct_ctime=datetime.utcfromtimestamp(ctiem.timestamp())
time_delay=timedelta(seconds=10)
task_time=uct_ctime+time_delay
result2=send_email.apply_async(args=['上官诚明',],eta=task_time)
print(result2.id)